package com.thiswhyme.fsplus;

import com.thiswhyme.fsplus.feign.httpclient.ThwmHttpClientFeignLoadBalancedConfiguration;
import com.thiswhyme.fsplus.sentinel.feign.defaultdegrade.BaseDegradeConfig;
import com.thiswhyme.fsplus.sentinel.feign.defaultfallback.SentinelFeignConfig;
import com.thiswhyme.fsplus.sentinel.feign.instancefilter.InstanceFilterDegradeConfig;
import com.thiswhyme.fsplus.sentinel.feign.instancefilter.SpringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

/**
 * @description: fs工具自动配置类
 * @author: thiswhyme
 * @date: 2021/4/30
 */
@EnableConfigurationProperties(FeignSentinelPlusProperties.class)
@Import({SentinelFeignConfig.class, ThwmHttpClientFeignLoadBalancedConfiguration.class, BaseDegradeConfig.class, InstanceFilterDegradeConfig.class})
public class FeignSentinelPlusAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(SpringUtils.class)
    public SpringUtils springUtils() {
        return new SpringUtils();
    }
}
